package homework0302;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NewForDemo1 {
    public static void main(String[] args) {
        String[] array = {"one", "two", "three", "four", "five"};
        for (int i = 0; i < array.length; i++) {
            System.out.println(array[i]);
        }
        for (String str : array) {
            System.out.println(str);
        }
        Collection c=new ArrayList();
        c.add("一");
        c.add("二");
        c.add("三");
        c.add("四");
        c.add("五");
        Iterator it=c.iterator();
        while (it.hasNext()){
            String str=(String) it.next();
            System.out.println(str);
        }
        for (Object obj:c){
            String str=(String) obj;
            System.out.println(str);
        }




    }
}
